home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / CMMComponent.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  11.2 KB  |  389 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        CMMComponent.a
  3. ;
  4. ;    Contains:    ColorSync CMM Component API
  5. ;
  6. ;    Version:    Technology:    ColorSync 2.5
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__CMMCOMPONENT__') = 'UNDEFINED' THEN
  19. __CMMCOMPONENT__ SET 1
  20.  
  21.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  22.     include 'Quickdraw.a'
  23.     ENDIF
  24.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  25.     include 'Components.a'
  26.     ENDIF
  27.     IF &TYPE('__CMAPPLICATION__') = 'UNDEFINED' THEN
  28.     include 'CMApplication.a'
  29.     ENDIF
  30.  
  31.  
  32. CMMInterfaceVersion                EQU        1
  33. ;  Component function selectors 
  34. ;  Required 
  35.  
  36. kCMMInit                        EQU        0
  37. kNCMMInit                        EQU        6
  38. kCMMMatchColors                    EQU        1
  39. kCMMCheckColors                    EQU        2
  40. ;  Optional 
  41.  
  42. kCMMValidateProfile                EQU        8
  43. kCMMFlattenProfile                EQU        14
  44. kCMMUnflattenProfile            EQU        15
  45. kCMMMatchBitmap                    EQU        9
  46. kCMMCheckBitmap                    EQU        10
  47. kCMMMatchPixMap                    EQU        3
  48. kCMMCheckPixMap                    EQU        4
  49. kCMMConcatenateProfiles            EQU        5
  50. kCMMConcatInit                    EQU        7
  51. kCMMNewLinkProfile                EQU        16
  52. kCMMGetPS2ColorSpace            EQU        11
  53. kCMMGetPS2ColorRenderingIntent    EQU        12
  54. kCMMGetPS2ColorRendering        EQU        13
  55. kCMMGetPS2ColorRenderingVMSize    EQU        17
  56. kCMMGetNamedColorInfo            EQU        70
  57. kCMMGetNamedColorValue            EQU        71
  58. kCMMGetIndNamedColorValue        EQU        72
  59. kCMMGetNamedColorIndex            EQU        73
  60. kCMMGetNamedColorName            EQU        74
  61.  
  62. ;
  63. ; pascal CMError NCMInit(ComponentInstance CMSession, CMProfileRef srcProfile, CMProfileRef dstProfile)
  64. ;
  65.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  66.         Macro
  67.         _NCMInit
  68.             move.l              #$00080006,-(sp)
  69.             moveq               #0,D0
  70.             dc.w                $A82A
  71.         EndM
  72.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  73.         IMPORT_CFM_FUNCTION NCMInit
  74.     ENDIF
  75.  
  76. ;
  77. ; pascal CMError CMInit(ComponentInstance CMSession, CMProfileHandle srcProfile, CMProfileHandle dstProfile)
  78. ;
  79.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  80.         Macro
  81.         _CMInit
  82.             move.l              #$00080000,-(sp)
  83.             moveq               #0,D0
  84.             dc.w                $A82A
  85.         EndM
  86.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  87.         IMPORT_CFM_FUNCTION CMInit
  88.     ENDIF
  89.  
  90. ;
  91. ; pascal CMError CMMatchColors(ComponentInstance CMSession, CMColor *myColors, unsigned long count)
  92. ;
  93.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  94.         Macro
  95.         _CMMatchColors
  96.             move.l              #$00080001,-(sp)
  97.             moveq               #0,D0
  98.             dc.w                $A82A
  99.         EndM
  100.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  101.         IMPORT_CFM_FUNCTION CMMatchColors
  102.     ENDIF
  103.  
  104. ;
  105. ; pascal CMError CMCheckColors(ComponentInstance CMSession, CMColor *myColors, unsigned long count, long *result)
  106. ;
  107.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  108.         Macro
  109.         _CMCheckColors
  110.             move.l              #$000C0002,-(sp)
  111.             moveq               #0,D0
  112.             dc.w                $A82A
  113.         EndM
  114.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  115.         IMPORT_CFM_FUNCTION CMCheckColors
  116.     ENDIF
  117.  
  118.  
  119. ;  Optional functions 
  120. ;
  121. ; pascal CMError CMMValidateProfile(ComponentInstance CMSession, CMProfileRef prof, Boolean *valid)
  122. ;
  123.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  124.         Macro
  125.         _CMMValidateProfile
  126.             move.l              #$00080008,-(sp)
  127.             moveq               #0,D0
  128.             dc.w                $A82A
  129.         EndM
  130.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  131.         IMPORT_CFM_FUNCTION CMMValidateProfile
  132.     ENDIF
  133.  
  134. ;
  135. ; pascal CMError CMMFlattenProfile(ComponentInstance CMSession, CMProfileRef prof, unsigned long flags, CMFlattenUPP proc, void *refCon)
  136. ;
  137.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  138.         Macro
  139.         _CMMFlattenProfile
  140.             move.l              #$0010000E,-(sp)
  141.             moveq               #0,D0
  142.             dc.w                $A82A
  143.         EndM
  144.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  145.         IMPORT_CFM_FUNCTION CMMFlattenProfile
  146.     ENDIF
  147.  
  148. ;
  149. ; pascal CMError CMMUnflattenProfile(ComponentInstance CMSession, FSSpec *resultFileSpec, CMFlattenUPP proc, void *refCon)
  150. ;
  151.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  152.         Macro
  153.         _CMMUnflattenProfile
  154.             move.l              #$000C000F,-(sp)
  155.             moveq               #0,D0
  156.             dc.w                $A82A
  157.         EndM
  158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION CMMUnflattenProfile
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal CMError CMMatchBitmap(ComponentInstance CMSession, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *matchedBitmap)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  166.         Macro
  167.         _CMMatchBitmap
  168.             move.l              #$00100009,-(sp)
  169.             moveq               #0,D0
  170.             dc.w                $A82A
  171.         EndM
  172.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  173.         IMPORT_CFM_FUNCTION CMMatchBitmap
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal CMError CMCheckBitmap(ComponentInstance CMSession, const CMBitmap *bitmap, CMBitmapCallBackUPP progressProc, void *refCon, CMBitmap *resultBitmap)
  178. ;
  179.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  180.         Macro
  181.         _CMCheckBitmap
  182.             move.l              #$0010000A,-(sp)
  183.             moveq               #0,D0
  184.             dc.w                $A82A
  185.         EndM
  186.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  187.         IMPORT_CFM_FUNCTION CMCheckBitmap
  188.     ENDIF
  189.  
  190. ;
  191. ; pascal CMError CMMatchPixMap(ComponentInstance CMSession, PixMap *myPixMap, CMBitmapCallBackUPP progressProc, void *refCon)
  192. ;
  193.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  194.         Macro
  195.         _CMMatchPixMap
  196.             move.l              #$000C0003,-(sp)
  197.             moveq               #0,D0
  198.             dc.w                $A82A
  199.         EndM
  200.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION CMMatchPixMap
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal CMError CMCheckPixMap(ComponentInstance CMSession, const PixMap *myPixMap, CMBitmapCallBackUPP progressProc, BitMap *myBitMap, void *refCon)
  206. ;
  207.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  208.         Macro
  209.         _CMCheckPixMap
  210.             move.l              #$00100004,-(sp)
  211.             moveq               #0,D0
  212.             dc.w                $A82A
  213.         EndM
  214.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  215.         IMPORT_CFM_FUNCTION CMCheckPixMap
  216.     ENDIF
  217.  
  218. ;
  219. ; pascal CMError CMConcatInit(ComponentInstance CMSession, CMConcatProfileSet *profileSet)
  220. ;
  221.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  222.         Macro
  223.         _CMConcatInit
  224.             move.l              #$00040007,-(sp)
  225.             moveq               #0,D0
  226.             dc.w                $A82A
  227.         EndM
  228.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  229.         IMPORT_CFM_FUNCTION CMConcatInit
  230.     ENDIF
  231.  
  232. ;
  233. ; pascal CMError CMNewLinkProfile(ComponentInstance CMSession, CMProfileRef *prof, const CMProfileLocation *targetLocation, CMConcatProfileSet *profileSet)
  234. ;
  235.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  236.         Macro
  237.         _CMNewLinkProfile
  238.             move.l              #$000C0010,-(sp)
  239.             moveq               #0,D0
  240.             dc.w                $A82A
  241.         EndM
  242.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  243.         IMPORT_CFM_FUNCTION CMNewLinkProfile
  244.     ENDIF
  245.  
  246. ;
  247. ; pascal CMError CMMGetPS2ColorSpace(ComponentInstance CMSession, CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  250.         Macro
  251.         _CMMGetPS2ColorSpace
  252.             move.l              #$0010000B,-(sp)
  253.             moveq               #0,D0
  254.             dc.w                $A82A
  255.         EndM
  256.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION CMMGetPS2ColorSpace
  258.     ENDIF
  259.  
  260. ;
  261. ; pascal CMError CMMGetPS2ColorRenderingIntent(ComponentInstance CMSession, CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon)
  262. ;
  263.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  264.         Macro
  265.         _CMMGetPS2ColorRenderingIntent
  266.             move.l              #$0010000C,-(sp)
  267.             moveq               #0,D0
  268.             dc.w                $A82A
  269.         EndM
  270.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  271.         IMPORT_CFM_FUNCTION CMMGetPS2ColorRenderingIntent
  272.     ENDIF
  273.  
  274. ;
  275. ; pascal CMError CMMGetPS2ColorRendering(ComponentInstance CMSession, CMProfileRef srcProf, CMProfileRef dstProf, unsigned long flags, CMFlattenUPP proc, void *refCon)
  276. ;
  277.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  278.         Macro
  279.         _CMMGetPS2ColorRendering
  280.             move.l              #$0014000D,-(sp)
  281.             moveq               #0,D0
  282.             dc.w                $A82A
  283.         EndM
  284.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  285.         IMPORT_CFM_FUNCTION CMMGetPS2ColorRendering
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal CMError CMMGetPS2ColorRenderingVMSize(ComponentInstance CMSession, CMProfileRef srcProf, CMProfileRef dstProf, unsigned long *vmSize)
  290. ;
  291.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  292.         Macro
  293.         _CMMGetPS2ColorRenderingVMSize
  294.             move.l              #$000C0011,-(sp)
  295.             moveq               #0,D0
  296.             dc.w                $A82A
  297.         EndM
  298.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  299.         IMPORT_CFM_FUNCTION CMMGetPS2ColorRenderingVMSize
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal CMError CMConcatenateProfiles(ComponentInstance CMSession, CMProfileHandle thru, CMProfileHandle dst, CMProfileHandle *newDst)
  304. ;
  305.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  306.         Macro
  307.         _CMConcatenateProfiles
  308.             move.l              #$000C0005,-(sp)
  309.             moveq               #0,D0
  310.             dc.w                $A82A
  311.         EndM
  312.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  313.         IMPORT_CFM_FUNCTION CMConcatenateProfiles
  314.     ENDIF
  315.  
  316. ;  Named Color functions 
  317. ;
  318. ; pascal CMError CMMGetNamedColorInfo(ComponentInstance CMSession, CMProfileRef srcProf, unsigned long *deviceChannels, OSType *deviceColorSpace, OSType *PCSColorSpace, unsigned long *count, StringPtr prefix, StringPtr suffix)
  319. ;
  320.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  321.         Macro
  322.         _CMMGetNamedColorInfo
  323.             move.l              #$001C0046,-(sp)
  324.             moveq               #0,D0
  325.             dc.w                $A82A
  326.         EndM
  327.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  328.         IMPORT_CFM_FUNCTION CMMGetNamedColorInfo
  329.     ENDIF
  330.  
  331. ;
  332. ; pascal CMError CMMGetNamedColorValue(ComponentInstance CMSession, CMProfileRef prof, StringPtr name, CMColor *deviceColor, CMColor *PCSColor)
  333. ;
  334.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  335.         Macro
  336.         _CMMGetNamedColorValue
  337.             move.l              #$00100047,-(sp)
  338.             moveq               #0,D0
  339.             dc.w                $A82A
  340.         EndM
  341.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION CMMGetNamedColorValue
  343.     ENDIF
  344.  
  345. ;
  346. ; pascal CMError CMMGetIndNamedColorValue(ComponentInstance CMSession, CMProfileRef prof, unsigned long index, CMColor *deviceColor, CMColor *PCSColor)
  347. ;
  348.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  349.         Macro
  350.         _CMMGetIndNamedColorValue
  351.             move.l              #$00100048,-(sp)
  352.             moveq               #0,D0
  353.             dc.w                $A82A
  354.         EndM
  355.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  356.         IMPORT_CFM_FUNCTION CMMGetIndNamedColorValue
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal CMError CMMGetNamedColorIndex(ComponentInstance CMSession, CMProfileRef prof, StringPtr name, unsigned long *index)
  361. ;
  362.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  363.         Macro
  364.         _CMMGetNamedColorIndex
  365.             move.l              #$000C0049,-(sp)
  366.             moveq               #0,D0
  367.             dc.w                $A82A
  368.         EndM
  369.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  370.         IMPORT_CFM_FUNCTION CMMGetNamedColorIndex
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal CMError CMMGetNamedColorName(ComponentInstance CMSession, CMProfileRef prof, unsigned long index, StringPtr name)
  375. ;
  376.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  377.         Macro
  378.         _CMMGetNamedColorName
  379.             move.l              #$000C004A,-(sp)
  380.             moveq               #0,D0
  381.             dc.w                $A82A
  382.         EndM
  383.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  384.         IMPORT_CFM_FUNCTION CMMGetNamedColorName
  385.     ENDIF
  386.  
  387.     ENDIF ; __CMMCOMPONENT__ 
  388.  
  389.